package com.qiuzhao.entity.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonResult<T> {
    private String code;
    private String message;
    private T data;

    public static <T> CommonResult success(T data) {
        return new CommonResult("200", "success", data);
    }

    public static CommonResult error(String message) {
        return new CommonResult("500", message, null);
    }
}
